<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>案例5</title>
</head>
<body>
<a href="http://www.baidu.com">跳转到百度</a>
</body>
<script>
    //获取到一个a标签对象
      dom = document.querySelector("a");
      //修改其href属性
      dom.href='http://www.jd.com'
</script>
</html>